<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCustomFormsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('custom_forms', function (Blueprint $table) {
            $table->integer('id')->unique()->comment('id');
            $table->integer('business_type_id')->default(0)->comment('业务类型单据');
            $table->string('name')->default('')->comment('表单名称');
            $table->tinyInteger('origin_type_id')->default(1)->comment('来源类型');
            $table->tinyInteger('status_type_id')->default(0)->comment('状态');
            $table->tinyInteger('is_default')->default(0)->comment('是否默认');

            $table->tinyInteger('is_tenant_update')->default(0)->comment('租户是否改动');
            $table->integer('created_id')->default(0)->comment('创建人');
            $table->integer('updated_id')->default(0)->comment('修改人');
            $table->integer('created_at')->default(0)->comment('创建时间');
            $table->integer('updated_at')->default(0)->comment('修改时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('custom_forms');
    }
}
